const ctx = new AudioContext();
const osc = ctx.createOscillator();
osc.connect(ctx.destination);
osc.frequency.value = 1600;
osc.start(0);

osc.type = "sine";
// osc.type = "square";
// osc.type = "triangle";
// osc.type = "sawtooth";

setTimeout(() => {
  osc.stop(1);
}, 500);
